	//TODO: add the attributes and the methods of the class;
	// responsibility: Equipe 1
package fr.uparis10.miage.m1p1.core;

import java.util.Calendar;
import java.util.Date;
import java.util.HashSet;

import fr.uparis10.miage.m1p1.global.EmplStatusEnum;
import fr.uparis10.miage.m1p1.global.PerfIndEnum;

public abstract class Employe {
	/* This Set is gonna hold the list of all Employee IDs: */
	private static HashSet<Integer> ms_empIdSet = new HashSet<Integer>();
	/* Will hold the last generated Employee ID: */
	private static int ms_lastEmpId = 0;
	/* This Set is gonna hold the list of all Social Security Numbers in the Enterprise: */
	private static HashSet<Long> ms_numSSSet = new HashSet<Long>();
	/* Holds the last generated Security Number ID: */
	private static long ms_lastNumSS = 0;
	
	private final int EMP_ID;
	private final long NUM_SEC_SOCIAL;
	private final Date JOIN_DATE;
	
	private String m_nom = "";
	private String m_addresse = "";
	private Date m_dateNaissance = Calendar.getInstance().getTime();
	private EmplStatusEnum m_status = EmplStatusEnum.ACTIVE;
	
	protected Departement m_dept;
	protected int m_salaire = 0;
	protected PerfIndEnum m_performanceInd = PerfIndEnum.C;
	
	/**
	 * This method will return the bonus for which the employee is eligible.
	 * To be implemented by inheriting classes.
	 */
	public abstract int calcBonus();
	
	/**
	 * Default constructor
	 */
	public Employe() {
		
		while (ms_empIdSet.contains(++ms_lastEmpId)); //skip already registered numbers, if any
		EMP_ID = ms_lastEmpId;
		/* Register the new EMP_ID */
		ms_empIdSet.add(EMP_ID);
		
		while (ms_numSSSet.contains(++ms_lastNumSS)); //skip already registered numbers, if any
		NUM_SEC_SOCIAL = ms_lastNumSS;
		ms_numSSSet.add(NUM_SEC_SOCIAL);
		
		JOIN_DATE = Calendar.getInstance().getTime();
	}
	
	/* --- Setters & Getters definition - START --- */
	public int getEmpId() {
		return EMP_ID;
	}

	public long getNumSecSocial() {
		return NUM_SEC_SOCIAL;
	}

	public Date getJoinDate() {
		return JOIN_DATE;
	}

	public void setNom(String m_nom) {
		this.m_nom = m_nom;
	}

	public String getNom() {
		return m_nom;
	}

	public void setAddresse(String m_addresse) {
		this.m_addresse = m_addresse;
	}

	public String getAddresse() {
		return m_addresse;
	}

	public void setDateNaissance(Date m_dateNaissance) {
		this.m_dateNaissance = m_dateNaissance;
	}

	public Date getDateNaissance() {
		return m_dateNaissance;
	}

	public void setStatus(EmplStatusEnum m_status) {
		this.m_status = m_status;
	}

	public EmplStatusEnum getStatus() {
		return m_status;
	}

	public void setDept(Departement dept) {
		this.m_dept = dept;
	}

	public Departement getDept() {
		return m_dept;
	}

	public void setSalaire(int salaire) {
		this.m_salaire = salaire;
	}
	
	public int getSalaire() {
		return m_salaire;
	}
	
	public void setPerformaceInd(PerfIndEnum performanceInd) {
		m_performanceInd = performanceInd;
	}

	public PerfIndEnum getPerformanceInd() {
		return m_performanceInd;
	}

	/* --- Setters & Getters definition - END --- */
}
